package com.wyl.niupi.framework.util.codeset.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wyl.niupi.framework.util.codeset.bo.SysCodeset;
import com.wyl.niupi.framework.util.codeset.dao.SysCodesetDao;
import com.wyl.niupi.framework.util.codeset.service.SysCodesetDetailService;
import com.wyl.niupi.framework.util.codeset.service.SysCodesetService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;

@Service("sysCodesetService")
public class SysCodesetServiceImpl extends ServiceImpl<SysCodesetDao, SysCodeset> implements SysCodesetService {

    @Resource
    private SysCodesetDao dao;
    @Resource
    private SysCodesetDetailService codesetDetailService;

//    @Transactional(rollbackOn = Exception.class)
    @Transactional
    @Override
    public void removeBoAndDetail(Integer lid) {
//        //先删除明细
//        QueryFilter filter = new QueryFilter(1, Integer.MAX_VALUE);
//        filter.where(SysCodesetDetail.CLID, Where.eq, lid);
//        List<SysCodesetDetail> list = codesetDetailService.getAll(filter);
//        if(!CollectionUtils.isEmpty(list)){
//            codesetDetailService.removeBatch(list);
//        }
//
//        //在删除主表
//        this.removeById(lid);
    }


}

